package com.gitee.wsl.func.predicate

fun interface TriPredicate<T, U, X> {

    fun test(t: T,u:U,v:X): Boolean

    fun and(other: TriPredicate<T, U, X>): TriPredicate<T, U, X> {
        return TriPredicate { t: T, u: U, v: X -> test(t, u, v) && other.test(t, u, v) }
    }

    fun or(other: TriPredicate<T, U, X>): TriPredicate<T, U, X> {
        return TriPredicate { t: T, u: U, v: X -> test(t, u, v) || other.test(t, u, v) }
    }
}